package com.Exception.DefinedException;

public class Teacher {
                                     //throws抛出异常类
    public void checkScore(int score) throws DefinedException {
        if (score < 0 || score > 100) {
            //throw抛出异常对象
            throw new DefinedException("您输入的得分有误，应在0-100");
        } else{
            System.out.println("分数正常");
        }
    }
}
